package events.edit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import snazzysprites.SnazzySprites;
import state.SnazzySpritesStateManager;

/**
 * This handler copies the selected shape to the clipboard, 
 * while removing it from the pose
 * @author Andrew
 */
public class CutHandler implements ActionListener
{
    /**
     * This method relays this event to the state manager, which
     * will update the clipboard accordingly.
     * 
     * @param ae The event object for this button press.
     */
    @Override
    public void actionPerformed(ActionEvent ae) 
    {
        SnazzySprites singleton = SnazzySprites.getSnazzySprites();
        SnazzySpritesStateManager poseurStateManager = singleton.getStateManager();
        poseurStateManager.copySelectedItem();
        poseurStateManager.getPose().removeShape(poseurStateManager.getSelectedShape());
    }   
}
